//
// Created by ltp on 22-6-22.
//

#ifndef FFMPEG_WASM_GUI_H
#define FFMPEG_WASM_GUI_H

#include <SDL2/SDL.h>
#include "util.h"

class GUI {
public:
    SDL_Window *win = nullptr;
    SDL_Renderer *renderer = nullptr;
    SDL_Texture *texture = nullptr;
    int width = 640;
    int height = 480;

    void init(int w, int h);

    void update(Stream *s);

    void render(const SDL_Rect *rect,
                const Uint8 *Yplane, int Ypitch,
                const Uint8 *Uplane, int Upitch,
                const Uint8 *Vplane, int Vpitch);
};

extern GUI gui;


#endif //FFMPEG_WASM_GUI_H
